package etc.spec.ytt.week09.homework;

import java.util.ArrayList;
import java.util.List;

public class Test {
        public static void main(String[] args) {
                List pets = new ArrayList();

                List sounds1 = new ArrayList();
                sounds1.add("miaomiao1");
                sounds1.add("miaomiao2");
                sounds1.add("miaomiao3");

                List foods1 = new ArrayList();
                Food food1 = new Food("鲫鱼", 8);
                Food food2 = new Food("小鱼", 6);
                Food food3 = new Food("汤泡饭", 2);
                foods1.add(food1);
                foods1.add(food2);
                foods1.add(food3);

                Cat cat1 = new Cat("cat1", sounds1, foods1);
                List sounds2 = new ArrayList();
                sounds2.add("wangwang11");
                sounds2.add("miaomiao22");
                sounds2.add("miaomiao33");

                List foods2 = new ArrayList();
                Food food12 = new Food("火腿肠", 12);
                Food food22 = new Food("排骨", 8);
                Food food23 = new Food("汤泡饭", 2);
                foods2.add(food12);
                foods2.add(food22);
                foods2.add(food23);
                Dog dog2 = new Dog("dog2", sounds2, foods2);

                pets.add(cat1);
                pets.add(dog2);
                Master tom = new Master(pets);
                for (int i = 0; i < tom.getPets().size(); i++) {
                        IPet pet = (IPet) pets.get(i);
                        tom.feed(pet);
                }
        }
}



